package lab02.test22;

public class Test {
    public static void main(String[] args) {
        //22、 	给定一个字符串，将字符串中的所有
        // 大写字母变成小写字母，数字用0 来代替，其他符号用#代替

        String result = "Hello, World!!! 2017";

        StringBuffer stringBuffer = new StringBuffer();
        StringBuilder stringBuilder = new StringBuilder();

        //hello##word####0000
        for (int i = 0; i < result.length() ; i++){
            char temp = result.charAt(i);
            if (temp >= 'A' && temp <= 'Z' ){
                stringBuffer.append((char)(temp+32));

            }else if (temp >= 'a' && temp <= 'z'){
                stringBuffer.append(temp);
            }else if (temp >= '0' && temp <='9'){
                stringBuffer.append('0');
            }else stringBuffer.append('#');
        }

        System.out.println(stringBuffer.toString());

    }
}
